//1、编写 router/index.js文件
import { createMemoryHistory, createRouter } from 'vue-router'

//2、配置路由表信息
const routes = [
    {
        path: '/',
        name: 'book',
        component: () => import('@/components/Book.vue'),
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/Login.vue'),
    },
    {
        path: '/register',
        name: 'register',
        component: () => import('@/views/Register.vue'),
    },
    {
        path: '/cart',
        name: 'cart',
        component: () => import('@/views/Cart.vue'),
    },
    {
        path: '/settlement',
        name: 'settlement',
        component: () => import('@/views/Settlement.vue'),
    },
    {
        path: '/order',
        name: 'order',
        component: () => import('@/views/Order.vue'),
    }
]

//创建路由器
const router = createRouter({
    history: createMemoryHistory(),
    routes,
})
export { router }
